package com.mm.base.forest;

import com.dtflys.forest.annotation.Request;

/**
 * 描述: 第三方几接口定义
 *
 * @author: yanglin
 * @Date: 2022-01-24-8:12
 * @Version: 1.0
 */
public interface ThirdPartyClient {

    /**
     * 免费天气API获取
     * https://www.sojson.com/blog/305.html
     * 上海宝山区[101020300] 巫山[101042000] 泉州[101230501]
     *
     * @return
     */
    @Request(
            url = "http://t.weather.itboy.net/api/weather/city/${0}",
            headers = "Accept: text/plain"
    )
    String queryWeatherDay(Integer cityCode);

    /**
     * 免费天气API获取
     *
     * @param cityName 城市名
     * @param type     查询类型(1.当天 2.未来7天 3.未来8-15天)
     * @return
     */
    @Request(
            url = "https://api.muxiaoguo.cn/api/tianqi?city=${0}&type=${1}",
            headers = "Accept: text/plain"
    )
    String queryWeatherOf(String cityName, Integer type);


    /**
     * 查询手机号归属地,支持虚拟号段
     * https://api.muxiaoguo.cn/api/mobile?phone=13429667827
     *
     * @param phone 手机号码
     * @return
     */
    @Request(
            url = "https://api.muxiaoguo.cn/api/mobile?phone=${0}",
            headers = "Accept: text/plain"
    )
    String queryMobileAddress(String phone);

    /**
     * 获取疫情地区风险等级、疫情数据、疫情热点
     *
     * @param type 请求类型，可选[epidemicRiskLevel(高危等级地区)，
     *             epidemicInfectionData(疫情数据)，epidemicHotspot(疫情热点)]
     * @return
     */
    @Request(
            url = "https://api.muxiaoguo.cn/api/epidemic?type=${0}",
            headers = "Accept: text/plain"
    )
    String queryEpidemic(String type);

    /**
     * 支持上百家物流信息查询
     * https://api.muxiaoguo.cn/api/Kuaidi?express=4316155889985
     *
     * @param express 快递单号
     * @return
     */
    @Request(
            url = "https://api.muxiaoguo.cn/api/Kuaidi?express=${0}",
            headers = "Accept: text/plain"
    )
    String queryExpressInfo(String express);
}
